package com.tom.service.impl;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;

import com.tom.util.JDBCUtil;

public class JinYD {

	/**
	 * 
	 * @author hanpengda
	 * @date 2018年6月1日
	 * @TODO 获取金源贷投资信息的url
	 */
	public static void work(){
		try {
			ArrayList<String> arrayList = JDBCUtil.getUrls("qss_jinyd_bussiness_data");
			ArrayList<String> list = new ArrayList<String>();
			for (int i = 0; i < arrayList.size(); i++) {
				String url = arrayList.get(i);
				url = url.replaceAll("http://www.jinyuandai.net/financeDetail.do\\?id=", "");
				url = "http://www.jinyuandai.net/financeCollection.do?paramMap.id="+url;
				Date now = new Date(); 
				SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
				String time = dateFormat.format(now);
				String sql = "insert into qss_jinyd_tzxx_url(url,insertdate) values("+"'"+url+"'"+","+"'"+time+"'"+")";
				System.out.println(sql);
				list.add(sql);
				
			}
			//JDBCUtil.insertData(list);
		} catch (Exception e) {
			// TODO: handle exception
		}
	}
}
